<template>
  <div class="box">
    <div class="head_box">
      <img src="../../assets/img/tuzi.gif" alt="" />
      <div class="name_box">{{ username }}--超级管理员</div>
      <div class="setTime">
        <i class="fa fa-clock-o"></i>
        注册时间
      </div>
    </div>
    <div class="body_box">
      <div class="contrl">
        <el-button size="small">
          <i class="fa fa-male"></i>
          个人中心
        </el-button>
        <el-button size="small">
          <i class="fa fa-key"></i>
          修改密码</el-button
        >
      </div>
    </div>
    <ul class="btn_ctr">
      <li><i class="fa fa-eraser"></i> 清除缓存</li>
      <li><i class="fa fa-user"></i> 在线人数</li>
      <li><i class="fa fa-bell"></i> 访问次数</li>
      <li><i class="fa fa-undo"></i> 备份还原</li>
    </ul>
    <div class="logout" @click="logout">
      <i class="fa fa-sign-out"></i> 退出登录
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      username: 'admin'
    }
  },
  methods: {
    logout() {
      window.sessionStorage.clear()
      this.$router.push('/login')
    }
  }
}
</script>

<style lang="less" scoped>
.box {
  width: 350px;
  height: 450px;
  background-color: #eee;
}
.head_box {
  background: rgb(20, 136, 154);
  height: 165px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  img {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 50%;
  }
  .name_box {
    margin: 10px 0;
    color: #fff;
  }
}
.contrl {
  display: flex;
  justify-content: center;
}
.btn_ctr {
  padding: 15px;
  li {
    width: 100%;
    height: 40px;
    line-height: 40px;

    .fa {
      margin-right: 5px;
    }
  }
}
.logout {
  height: 40px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
}
.setTime {
  color: #fff;
}
</style>
